package com.terren.webdig.setting.entity;

import java.util.List;

import com.terren.webdig.basic.BasicEntity;

/**
 * 表u_role
 *
 */
public class Role extends BasicEntity{

	private Integer roleId;
	private String roleName;
	private String functionIds;
	private String functionNames;
	private List<RoleFunction> list;
	private List<Function> functionsList;

	public List<Function> getFunctionsList() {
		return functionsList;
	}

	public void setFunctionsList(List<Function> functionsList) {
		this.functionsList = functionsList;
	}

	public String getFunctionIds() {
		if (functionIds == null) {
			StringBuffer sbff = new StringBuffer();
			if (list != null && list.size() > 0) {
				for (int i = 0; i < list.size(); i++) {
					sbff.append(list.get(i).getFunctionId());
					if (i < list.size() - 1) {
						sbff.append(",");
					}
				}
			}
			functionIds = sbff.toString();
		}
		return functionIds;
	}
	/*
	 * public String getFunctionNames() { if(functionNames == null) {
	 * StringBuffer sbff = new StringBuffer(); if(list != null && list.size() >
	 * 0) { for(int i=0;i<list.size();i++) {
	 * sbff.append(list.get(i).getFunctionName()); if(i < list.size() - 1) {
	 * sbff.append(","); } } } functionNames = sbff.toString(); } return
	 * functionNames; }
	 */

	public Integer getRoleId() {
		return roleId;
	}

	/*
	 * public String getFunctionIds() { return functionIds; }
	 */

	public void setFunctionIds(String functionIds) {
		this.functionIds = functionIds;
	}

	public String getFunctionNames() {
		return functionNames;
	}

	public void setFunctionNames(String functionNames) {
		this.functionNames = functionNames;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public List<RoleFunction> getList() {
		return list;
	}

	public void setList(List<RoleFunction> list) {
		this.list = list;
	}

}
